﻿<%@ Page Title="Regras" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="CadastroRegras.aspx.cs" Inherits="AcadPosApp.Administrativo.Cadastros.CadastroRegras" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlConsulta" runat="server" GroupingText="Consulta">
        <table class="form-inline">
            <tr>
                <td class="style2">
                    <asp:Label ID="Label3" runat="server" Text="Descrição"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtPesquisa" required="required" runat="server" Width="300px" 
                        style="margin-right: 10px"></asp:TextBox>
                </td>
                <td>
                    <br />
                    <asp:Button ID="btnConsultar" runat="server" Text="Consultar"
                        OnClick="btnConsultar_Click" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwRegras" runat="server" CssClass="mGrid" EmptyDataText="Dados não localizados..."
            GridLines="Vertical" OnRowCommand="gvwRegras_RowCommand" Width="25%" 
            onrowcreated="gvwRegras_RowCreated" 
            onrowdatabound="gvwRegras_RowDataBound" AllowPaging="True" 
            onpageindexchanging="gvwRegras_PageIndexChanging">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>               
                <asp:TemplateField HeaderText="Excluir" ShowHeader="False">
                    <ItemTemplate>
                        <abbr title="Excluir regra!">
                            <asp:ImageButton Width="20px" ID="ImgExcluir" runat="server" Formnovalidate="Formnovalidate" CausesValidation="false"
                                OnClientClick="return ShowConfirm('Tem certeza que deseja excluir?', this.ID);"
                                CommandName="Excluir" ImageUrl="~/Imagens/delete.png" Text="Excluir" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <br />
        <div class="legenda">
            <asp:Button ID="btnNovo" runat="server" Text="Novo" Width="80px" Formnovalidate="Formnovalidate" OnClick="btnNovo_Click" />
        </div>
        <br />
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlEdicao" runat="server" GroupingText="Cadastro de Regras" 
        Visible="False">
        <table class="style1">
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Descrição"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtRegra" runat="server" required Width="300px" MaxLength="40"></asp:TextBox>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        <br />
        <div class="legenda">
            <asp:Button ID="btnConfirmar" runat="server" Text="Confirmar" Width="80px" OnClick="btnConfirmar_Click" />
            &nbsp;<asp:Button ID="btnCancelar" runat="server" formnovalidate="formnovalidate" Text="Cancelar"
                Width="80px" OnClick="btnCancelar_Click" />
        </div><br />
    </asp:Panel>
</asp:Content>
